package com.lotusfall.service.impl;

import com.lotusfall.pojo.Student;
import com.lotusfall.service.StudentService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;


/**
 *  使用dubbo中的注解暴露服务
 */

@DubboService(interfaceClass = StudentService.class,version = "1.0",timeout = 5000)
public class StudentServiceImpl implements StudentService {
    @Override
    public Student queryStudent(Integer id) {
        Student student = new Student();
        if ( 1001 == id){
            student.setId(1001);
            student.setName("6661001-张三666");
            student.setAge(20);
        }else if ( 1002 == id){
            student.setId(1002);
            student.setName("====1002-李四====");
            student.setAge(22);
        }

        return student;
    }
}
